import { defineConfig, presetAttributify, presetUno } from "unocss";
import presetRemToPx from "@unocss/preset-rem-to-px";

export default defineConfig({
	/** 预设 */
	presets: [
		// 修改字体基准
		presetRemToPx({
			baseFontSize: 4,
		}),
		/** 属性化模式 & 无值的属性模式 */
		presetAttributify(),
		/** 默认预设 */
		presetUno(),
	],
	/** 自定义规则 */
	rules: [["uno-padding-20", { padding: "20px" }]],
	/** 自定义快捷方式 */
	shortcuts: [
		["center-x", "flex justify-center"],
		["center-y", "flex items-center"],
		["center", "flex justify-center items-center"],
		["btn", "py-2 px-4 font-semibold rounded-lg shadow-md"],
		["btn-primary", "text-white bg-primary hover:bg-primary-dark"],
		["btn-secondary", "text-white bg-secondary hover:bg-secondary-dark"],
	],
});
